import {ref,watch} from "vue"
const useAdd = (num1:any,num2:any)=>{
  const addNum = ref(0);
  watch([num1,num2],(newVal, oldVal)=>{
    addFunc(newVal[0], newVal[1])
  },{deep:true})
  const addFunc = (num1:number,num2:number)=>{
    addNum.value =+num1 + (+num2)
  }
  return {
    addNum,
    addFunc
  }
}
export default useAdd
